<template>
  <div>
    <!-- 砍价列表 -->
    <div class="goodsdetails_header">
      <div class="header_logo">
        <van-icon @click="back" name="arrow-left" size="0.4rem" />
      </div>
      <div class="header_title">砍价列表</div>
    </div>
    <div class="goodsdetails_body">
      <GoodsListCard :goods="list"></GoodsListCard>
    </div>
  </div>
</template>

<script>
//砍价商品列表
import GoodsListCard from "../components/home/GoodsListCard";
export default {
  components: {
    GoodsListCard
  },
  computed: {
    // 砍价列表
    list: function() {
      return this.$store.state.listModule.listItems;
    }
  },
  //请求商品列表
  mounted() {
    //砍价列表
    this.$store.dispatch("getList");
  },
  methods: {
    back() {
      //返回事件
      window.history.back();
    }
  }
};
</script>

<style scoped>
.goodsdetails_header {
  width: 100%;
  height: 1rem;
  display: flex;
  justify-content: left;
  position: fixed;
  top: 0;
  background-color: #fff;
  z-index: 7;
}
.header_logo {
  width: 20%;
  margin-left: 5%;
  text-align: left;
  line-height: 1.2rem;
}
.header_title {
  width: 60%;
  text-align: center;
  line-height: 1rem;
  font-size: 0.4rem;
}
.goodsdetails_body {
  margin-top: 1rem;
}
</style>